﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System.Globalization;

namespace Winz.JsonModel
{
    public class Players
    {
        public int player_id{ get; set; }
        public string name{ get; set; }
        public string last_visit{ get; set; }
        public string first_visit{ get; set; }
        public string total_visit{ get; set; }
    }

    public class OtherPlayer
    {
        [JsonProperty("score")]
        public string _score { get {return this.Score.ToString(); }
            set { this.Score = double.Parse(value, CultureInfo.InvariantCulture.NumberFormat); }
        }
        public double Score;
        [JsonProperty("rank")]
        public int Rank { get; set; }

        [JsonProperty("is_online")]
        public bool? IsOnline { get; set; }

        [JsonProperty("is_friend")]
        public bool IsFriend { get; set; }

        [JsonProperty("is_neighbor")]
        public bool IsNeighbor { get; set; }

        [JsonProperty("is_guild_member")]
        public bool IsGuildMember { get; set; }

        [JsonProperty("is_invited")]
        public object IsInvited { get; set; }

        [JsonProperty("is_self")]
        public bool IsSelf { get; set; }

        [JsonProperty("next_interaction_in")]
        public long? _nextInteractionIn { get {return this.NextInteractionIn;}
                                        set { this.NextInteractionIn = (value == null) ? 0 : (long)value; } 
                                        }
        public long NextInteractionIn;

        [JsonProperty("profile_text")]
        public string ProfileText { get; set; }

        [JsonProperty("city_name")]
        public string CityName { get; set; }

        [JsonProperty("clan_id")]
        public int? ClanId { get; set; }

        [JsonProperty("clan")]
        public object Clan { get; set; }

        [JsonProperty("trade_profile")]
        public object TradeProfile { get; set; }

        [JsonProperty("won_battles")]
        public object WonBattles { get; set; }

        [JsonProperty("has_great_building")]
        public object HasGreatBuilding { get; set; }

        [JsonProperty("is_active")]
        public object IsActive { get; set; }

        [JsonProperty("is_guest")]
        public object IsGuest { get; set; }

        [JsonProperty("player_id")]
        public int PlayerId { get; set; }

        [JsonProperty("name")]
        public string Name { get; set; }

        [JsonProperty("avatar")]
        public string Avatar { get; set; }

        [JsonProperty("__class__")]
        public string Class { get; set; }
    }

/*    public class Clan
    {
        public object points { get; set; }
        public object rank { get; set; }
        public object members { get; set; }
        public object flags_bought { get; set; }
        public object invitedUsers { get; set; }
        public int id { get; set; }
        public string name { get; set; }
        public string description { get; set; }
        public int membersNum { get; set; }
        public string flag { get; set; }
        public string __class__ { get; set; }
    }
*/
/*    public class TradeProfile
    {
        public List<object> offers { get; set; }
        public List<object> needs { get; set; }
        public string __class__ { get; set; }
    }
*/
    public class Member
    {
        public int permissions { get; set; }
        public string title { get; set; }
        public object activity { get; set; }
        public double score { get; set; }
        public int rank { get; set; }
        public bool is_online { get; set; }
        public bool is_friend { get; set; }
        public bool is_neighbor { get; set; }
        public bool is_guild_member { get; set; }
        public object is_invited { get; set; }
        public bool is_self { get; set; }
        public int next_interaction_in { get; set; }
        public string profile_text { get; set; }
        public string city_name { get; set; }
        public int clan_id { get; set; }
        public Clan clan { get; set; }
        public TradeProfile trade_profile { get; set; }
        public int won_battles { get; set; }
        public bool has_great_building { get; set; }
        public bool is_active { get; set; }
        public object is_guest { get; set; }
        public int player_id { get; set; }
        public string name { get; set; }
        public string avatar { get; set; }
        public string __class__ { get; set; }
    }

    public class User
    {
        public int score { get; set; }
        public int rank { get; set; }
        public object is_online { get; set; }
        public object is_friend { get; set; }
        public object is_neighbor { get; set; }
        public object is_guild_member { get; set; }
        public object is_invited { get; set; }
        public object is_self { get; set; }
        public object next_interaction_in { get; set; }
        public string profile_text { get; set; }
        public string city_name { get; set; }
        public object clan_id { get; set; }
        public object clan { get; set; }
        public object trade_profile { get; set; }
        public object won_battles { get; set; }
        public object has_great_building { get; set; }
        public bool is_active { get; set; }
        public object is_guest { get; set; }
        public int player_id { get; set; }
        public string name { get; set; }
        public string avatar { get; set; }
        public string __class__ { get; set; }
    }

    public class InvitedUser
    {
        public object clan { get; set; }
        public User user { get; set; }
        public string date { get; set; }
        public string __class__ { get; set; }
    }

    public class ClanResponseData
    {
        public int points { get; set; }
        public int rank { get; set; }
        public List<Member> members { get; set; }
        public List<string> flags_bought { get; set; }
        public List<InvitedUser> invitedUsers { get; set; }
        public int id { get; set; }
        public string name { get; set; }
        public string description { get; set; }
        public int membersNum { get; set; }
        public string flag { get; set; }
        public string __class__ { get; set; }
    }

}
